package com.shinektv.heartbeat;


/**
 * 协议数据包
 */
public class ProtocolCommonPacket {
    public static final byte SEND_DATA_TYPE_REGISTER = 0;
    public static final byte SEND_DATA_TYPE_PING = 1;
    public static final byte SEND_DATA_TYPE_PONG = 2;
    public static final byte SEND_DATA_TYPE_TEXT = 3;
    public static final byte SEND_DATA_TYPE_BINARY = 4;
    public static final byte[] START_TAG = new byte[]{-1, -1, -1};
    byte mSendDataType = 1;
    int mBodyLength = 0;
    byte[] mBodyContent = null;

    public ProtocolCommonPacket() {
    }

    public void setBodyContent(byte[] data) {
        if (data != null) {
            this.mBodyContent = (byte[])data.clone();
        }

    }

    public byte[] getBodyContent() {
        return this.mBodyContent;
    }

    public void setDataType(byte type) {
        this.mSendDataType = type;
    }

    public byte getDataType() {
        return this.mSendDataType;
    }

    public void setBodyLength(int bodyLength) {
        this.mBodyLength = bodyLength;
    }

    public int getBodyLength() {
        return this.mBodyLength;
    }

}
